--require "ICom/IDraw"

function CreateBloodBar(argtable)
	local at = argtable or {}
	bb = {}
	--bb.vtarget = at.blood
	bb.vmax = at.vmax or 100
	bb.vmin = at.vmin or 0
	SetIDraw(bb,{texname = "redbar", w = 50, h = 4})
	return bb
end

function UpdateBloodBar(bb,role)
	local f = role.blood / bb.vmax
	role.bloodbar.x = role.x + 5 * ((role.belong == "left" and 1) or (-1))
	role.bloodbar.y = role.y + 35
	bb.scaleX = f
end



